package cn.object.java.com;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class Erjinzhi {
private static FileOutputStream outfile;

public static void main(String[] args) {
	DataOutputStream out=null;
	DataInputStream dis=null;
	FileInputStream fis=null;
	FileOutputStream outfile=null;
	try {
		fis=new FileInputStream("d:\\demo\\1.class");
		dis=new DataInputStream(fis);
		 outfile = new FileOutputStream("d:\\6.txt");
		out= new DataOutputStream(outfile);
		int temp;
		while((temp=dis.read())!=-1){
			out.write(temp);
			out.close();
		}
	} catch (FileNotFoundException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	} catch (IOException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}finally{
		try {
			dis.close();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		try {
			fis.close();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
	}
		try {
			outfile.close();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
}
}
}